﻿@{
    ViewBag.Title = "Inventarios";
    WebGrid grid = new WebGrid(ViewBag.Lista);
}

<h2>Reporte de Inventarios</h2>
<br />
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load("visualization", "1", {packages:["corechart"]});
        google.setOnLoadCallback(drawChart);
        function drawChart() {
            $.post('GetDataInventario', {}, function(data){
                var tdata = new google.visualization.DataTable();

                tdata.addColumn('string', 'Country');
                tdata.addColumn('number', 'Population');

                for (var i = 0; i < data.length; i++) {
                    tdata.addRow([data[i].Name, data[i].Value]);
                }

                var options = {
                    title: 'Inventarios',
                    backgroundColor: '#efeeef'
                };

                var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
                chart.draw(tdata, options);
            });
        };
</script>

<div id="chart_div" style="width: 800px; height: 300px"></div>

@grid.GetHtml(columns: new [] {
    grid.Column("Name",
                header: "Producto"),
    grid.Column("House",
                header: "Almacén"),
    grid.Column("Value",
                header: "Cantidad"),
})